<?php 
if (!empty($this->flash_messages))
{
    foreach ($this->flash_messages as $flash_message)
    {
        echo '<div class="message">'.$flash_message.'</div>';
    }
}
?>   

<?php if (!empty($this->nodes)) : ?>
    <?php if (count($this->nodes)>1) : ?>
        <?php foreach ($this->nodes as $node) : ?>
          <div class="node-item home">
            <h2>
                <em class="date"><?php echo date('d.m.Y',strtotime($node->publish_date)) ?></em>
                <?php if (!empty($node->url_alias)) : ?>
                    <a href="<?php echo $this->fixUrl('page/'.$node->url_alias) ?>.html" rel="<?php echo $this->fixUrl('node/view/'.$node->url_alias) ?>"><?php echo htmlspecialchars($node->title) ?></a>
                <?php else : ?>
                    <a href="<?php echo $this->fixUrl('node/id/'.$node->id) ?>"><?php echo htmlspecialchars($node->title) ?></a>
                <?php endif; ?> 
            </h2>
            <?php $thumbnail=$node->getThumbnail(); ?>
            <?php if (!empty($thumbnail) && is_array($thumbnail) && count($thumbnail)==2 && !empty($thumbnail[0])) : ?>
            <div class="node-thumbnail"><?php echo $this->image('uploads',$thumbnail[0],$thumbnail[1],200,150,false) ?></div>
            <?php endif; ?>
            <div class="teaser"><?php echo nl2br(strip_tags($node->short_text)) ?></div>
            <div class="category">
                <?php echo '<span>'.Zend_Registry::get('locale')->_('Category').': </span>'?>
                <a href="<?php echo $this->fixUrl('category/'.$node->category) ?>" rel="<?php echo $this->fixUrl('node/category/'.$node->category) ?>"><?php echo $node->getCategory(); ?></a>
            </div>
          </div>
          <div class="clear"></div>
        <?php endforeach; ?>
    <?php else : ?>
        <div class="node-item home node-view">
            <h1>
                <?php echo htmlspecialchars($this->nodes[0]->title) ?>
            </h1>
            <p><?php echo $this->nodes[0] ?></p>
          </div>
    <?php endif; ?>
<?php endif; ?>

